package com.itlong.cloud.enumerate.ecode;

import lombok.Getter;
import lombok.Setter;

/**
 * <desc>
 * SDKV3服务端错误码定义
 * </desc>
 *
 * @createDate 2021-05-17
 */
public enum SDKV3ErrorCodeEnum {

    DEVICE_UNIQUE_ERROR(11, 1, "设备编码格式错误"),
    PROJECT_NOT_EXIST(11, 2, "项目不存在"),
    YQK_NOT_EXIST(11, 3, "群控器不存在"),
    YQK_FLOOR_NOT_EXIST(11, 4, "群控器外呼不存在"),
    ELEVATOR_HAS_TASK(11, 5, "当前电梯已有你的乘梯任务"),
    ELEVATOR_HAS_ROBOT(11, 6, "当前电梯已有机器人在执行乘梯任务"),
    OPEN_DOOR_FOR_YQK_ERROR(11, 7, "不允许给群控器发送开关门指令"),
    ALLOW_OPEN_DOOR_ERROR(11, 8, "机器人只能给已有任务关联的电梯发送开关门指令"),
    HAS_BIND_YQK_ERROR(11, 9, "绑定群控器的设备只能通过群控器乘梯"),
    PROJECT_ID_NOT_SET(11, 10, "项目id未设置"),
    SUBMIT_TO_IOT_TIMEOUT(11, 11, "指令下达给设备网络超时"),
    PARSE_IOT_HTTP_ERROR(11, 12, "解析IOT HTTP返回值失败"),
    TASK_NOT_EXIST(11, 13, "乘梯任务不存在"),
    OPEN_DOOR_STEP_ERROR(11, 14, "发送开门指令对应的乘梯阶段不正确"),
    DOOR_OPEN_TIME_ERROR(11, 15, "预约电梯接口开门时长范围为1-99的整数"),
    DEVICE_EXECUTE_ERROR(11, 16, "设备拒绝执行指令"),
    API_LIMIT_ERROR(11, 17, "请求接口太频繁"),
    REQUEST_ID_LENGTH_ERROR(11, 18, "requestId长度错误"),
    APP_ID_STATUS_ERROR(11, 19, "你的appId已被禁用"),
    DOCK_MODE_ERROR(11, 20, "对接方式未勾选云对接"),
    DEVELOP_TYPE_ERROR(11, 21, "你申请的不是机器人开发者账号"),
    AUTH_TIME_ERROR(11, 22, "当前不在机器人开发者账号授权时间范围内"),
    AUTH_YDT_ERROR(11, 23, "未勾选单梯云对接"),
    AUTH_YQK_ERROR(11, 24, "未勾选多梯自动调度云对接"),
    TIMESTAMP_VERIFY_ERROR(11, 25, "时间戳参数校验失败"),
    SIGN_VERIFY_ERROR(11, 26, "签名参数校验失败"),
    ROBOT_ID_VERIFY_ERROR(11, 27, "机器人编号参数校验失败"),
    ENCRYPTSCRIPT_VERIFY_ERROR(11, 28, "加密参数校验失败"),
    ENCRYPT_TYPE_VERIFY_ERROR(11, 29, "加密方式不符合规范"),
    FROM_FLOOR_ERROR(11, 30, "出发楼层超出范围"),
    TO_FLOOR_ERROR(11, 31, "目的楼层超出范围"),
    NO_DEVICE_UNIQUE_ERROR(11, 32, "缺少deviceUnique参数"),
    NO_FROM_FLOOR_ERROR(11, 33, "缺少fromFloor参数"),
    NO_TO_FLOOR_ERROR(11, 34, "缺少toFloor参数"),
    NO_OPEN_TIME_ERROR(11, 35, "缺少openTime参数"),
    NO_EFFECTIVE_TIME_ERROR(11, 36, "缺少effectiveTime参数"),
    NO_POSITION_ERROR(11, 37, "缺少position参数"),
    POSITION_ERROR(11, 38, "position只能是in或者out"),
    COMMAND_OPEN_DOOR_ERROR(11, 39, "与乘梯流程不符合的开关门指令"),
    DEVICE_AUTH_ERROR(11, 40, "机器人无相应设备权限"),
    ENCRYPT_ERROR(11, 41, "解密失败，请检查参数是否正确"),
    EFFECTIVE_TIME_ERROR(11, 42, "effectiveTime应为0到99之间的整数"),
    PROJECT_IS_NOT_ACTIVATED(11, 43, "项目未启用！"),
    TASK_DELETE_TAG(11, 44, "任务被删除，请重新预约电梯"),
    YQK_ONLINE_ERROR(11, 45, "群控器不在线"),
    USER_ID_OR_APP_SECRET_ERROR(11, 46, "token中未解析出用户ID或者秘钥"),
    ELEVATOR_HAS_OTHER_TASK(11, 47, "当前电梯已有别人的乘梯任务"),
    IOT_ERROR(11, 48, "项目设置的物联网平台不正确"),
    NO_DOOR_OPEN_TIME_ERROR(11, 49, "剩余开门时长不足"),
    ENTRY_DEVICE_UNIQUE_ERROR(11, 50, "群控器派梯异常，任务已取消"),
    ;

    @Setter
    @Getter
    private ErrorCode errorCode = new ErrorCode();

    /**
     * <desc>
     * 全参构造函数
     * </desc>
     *
     * @param mainCode 主错误码
     * @param subCode  子错误码
     * @param codeMsg  错误信息
     * @author zhouchun
     * @createDate 2021-05-17
     */
    SDKV3ErrorCodeEnum(Integer mainCode, Integer subCode, String codeMsg) {
        errorCode.setMainCode(mainCode);
        errorCode.setSubCode(subCode);
        errorCode.setCodeMsg(codeMsg);
    }

}